package com.zhijiaoyun.service.core;

import com.zhijiaoyun.model.dto.PageList;

/**
 * @author shisfish
 * @date 2018/1/18
 */
public interface IBaseService<T> {

    /**
     * insert
     * @param t
     */
    void insert(T t);

    /**
     * update
     * @param t
     */
    void update(T t);

    /**
     * delete
     * @param t
     */
    void delete(T t);

    /**
     * delete by id
     * @param id
     */
    void deleteById(long id);

    /**
     * get by primary key
     * @param id
     * @return
     */
    T getById(long id);

    /**
     * page by params
     * all args can not be null
     * @param pageIndex
     * @param pageSize
     * @param args
     * @return
     */
    PageList<T> page(int pageIndex, int pageSize, Object... args);

}

